import config from "@/config";
import http from "@/utils/request";

export default {
	question: {
		url: `${config.API_URL}/webide/questions`,
		name: "获取试题",
		get: async function () {
			return await http.get(this.url);
		},
	},
	langs: {
		url: `${config.API_URL}/webide/langs`,
		name: "获取语言",
		get: async function (questionKey) {
			return await http.get(this.url + "?questionKey=" + questionKey);
		},
	},
	run: {
		url: `${config.API_URL}/webide/run`,
		name: "运行代码",
		post: async function (data) {
			return await http.post(this.url, data);
		},
	},

	result: {
		url: `${config.API_URL}/webide/result/`,
		name: "运行代码",
		get: async function (data) {
			return await http.get(this.url + data);
		},
	},
};
